// pages/user/user.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
      nickName:'',//用户名称
      avatarUrl:'',//用户头像
      coach_name:'',//
      tr:1,//退出弹窗
      level: '',
      levels:""

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      var This = this;
        This.setData({
            nickName: wx.getStorageSync('coachName'),
            avatarUrl: wx.getStorageSync('imgUrl'),
            coach_name: wx.getStorageSync('storeName'),
            levels: wx.getStorageSync('level'),
        })
        if(wx.getStorageSync('level') == 1){
            This.setData({
                level:'普通私教'
            })
        } else if (wx.getStorageSync('level') == 2) {
            This.setData({
                level: '私教主管'
            })
        } else if (wx.getStorageSync('level') == 3) {
            This.setData({
                level: '私教经理'
            })
        }
  },
  //退出弹窗显示
    tuichu: function () { 
        var This = this;
        This.setData({ 
            tr: 2
        })
    },
    //退出弹窗隐藏
    tuichu_cel: function () {
        var This = this;
        This.setData({
            tr: 1
        })
    },
      //更换手机号
    exit:function(){
        var This = this;
        wx.reLaunch({
            url: "../phone_login/phone_login"
        })        
    },
    //我的跟进记录跳转
    to_follow_up:function(){
        var This = this;
        wx.navigateTo({
            url: '../follow_up/follow_up',
        })
    },
    //审批管理
    approval_management:function(){
        var This = this;
        wx.navigateTo({
            url: '../examination_and_approval/examination_and_approval',
        })
    },
    operating_password(){
        wx.navigateTo({
            url: '../operating_password/operating_password',
        })
    },
    protocol_management: function () {
        var This = this;
        wx.navigateTo({
            url: '../agreement_management/agreement_management',
        })
        
    },
    my_rest: function () {
        var This = this;
        wx.navigateTo({
            url: '../myRest/myRest',
        })
    },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
      var This = this;
      This.onLoad();
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () { 

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})